#include <cstdio>
using namespace std;

#define VECTOR_SIZE 10

void PrintVector(int[], int);

int main()
{
    int v[VECTOR_SIZE] = {0}, to_insert;
    for (int i = 0; i < 9; i++)
        scanf(" %d", v + i);
    scanf(" %d", &to_insert);

    int i = 0, j = VECTOR_SIZE - 1;
    while (to_insert > v[i])
        i++;
    while (j > i) {
        v[j] = v[j - 1];
        j--;
    }
    v[i] = to_insert;
    PrintVector(v, VECTOR_SIZE);    

    return 0;
}

void PrintVector(int v[], int n)
{
    for (int i = 0; i < n; i++)
        printf("%d\n", v[i]);
}